export{}





interface IUser {
    name: string;
    email: string;
    password: string;
}

//keyof后面跟接口  表示接口的这些属性名之一（键值）

type pType=keyof IUser;
// 相当于
// ptype pType = "name" | "email" | "password";

let p1: pType = "name";



// in
type StrOrNum = string | number;

type Ptype={
    [key in  StrOrNum]:string
}
let obj: Ptype = {
    1:"1",
    "key":'2'
}
